\(\int \frac {5+2 x^2}{-1+x^4} \, dx\) [13]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 15, antiderivative size = 13 \[ \int \frac {5+2 x^2}{-1+x^4} \, dx=-\frac {3 \arctan (x)}{2}-\frac {7 \text {arctanh}(x)}{2} \]

[Out]

-3/2*arctan(x)-7/2*arctanh(x)

Rubi [A] (verified)

Time = 0.00 (sec) , antiderivative size = 13, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {1181, 213, 209} \[ \int \frac {5+2 x^2}{-1+x^4} \, dx=-\frac {3 \arctan (x)}{2}-\frac {7 \text {arctanh}(x)}{2} \]

[In]

Int[(5 + 2*x^2)/(-1 + x^4),x]

[Out]

(-3*ArcTan[x])/2 - (7*ArcTanh[x])/2

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 213

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[b, 2])^(-1))*ArcTanh[Rt[b, 2]*(x/Rt[-a, 2])]
, x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rule 1181

Int[((d_) + (e_.)*(x_)^2)/((a_) + (c_.)*(x_)^4), x_Symbol] :> With[{q = Rt[(-a)*c, 2]}, Dist[e/2 + c*(d/(2*q))
, Int[1/(-q + c*x^2), x], x] + Dist[e/2 - c*(d/(2*q)), Int[1/(q + c*x^2), x], x]] /; FreeQ[{a, c, d, e}, x] &&
 NeQ[c*d^2 - a*e^2, 0] && PosQ[(-a)*c]

Rubi steps \begin{align*} \text {integral}& = -\left (\frac {3}{2} \int \frac {1}{1+x^2} \, dx\right )+\frac {7}{2} \int \frac {1}{-1+x^2} \, dx \\ & = -\frac {3}{2} \tan ^{-1}(x)-\frac {7}{2} \tanh ^{-1}(x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.92 \[ \int \frac {5+2 x^2}{-1+x^4} \, dx=-\frac {3 \arctan (x)}{2}+\frac {7}{4} \log (1-x)-\frac {7}{4} \log (1+x) \]

[In]

Integrate[(5 + 2*x^2)/(-1 + x^4),x]

[Out]

(-3*ArcTan[x])/2 + (7*Log[1 - x])/4 - (7*Log[1 + x])/4

Maple [A] (verified)

Time = 0.22 (sec) , antiderivative size = 18, normalized size of antiderivative = 1.38

method result size
default \(\frac {7 \ln \left (x -1\right )}{4}-\frac {7 \ln \left (x +1\right )}{4}-\frac {3 \arctan \left (x \right )}{2}\) \(18\)
risch \(\frac {7 \ln \left (x -1\right )}{4}-\frac {7 \ln \left (x +1\right )}{4}-\frac {3 \arctan \left (x \right )}{2}\) \(18\)
parallelrisch \(\frac {7 \ln \left (x -1\right )}{4}+\frac {3 i \ln \left (x -i\right )}{4}-\frac {3 i \ln \left (x +i\right )}{4}-\frac {7 \ln \left (x +1\right )}{4}\) \(30\)
meijerg \(\frac {5 x \left (\ln \left (1-\left (x^{4}\right )^{\frac {1}{4}}\right )-\ln \left (1+\left (x^{4}\right )^{\frac {1}{4}}\right )-2 \arctan \left (\left (x^{4}\right )^{\frac {1}{4}}\right )\right )}{4 \left (x^{4}\right )^{\frac {1}{4}}}+\frac {x^{3} \left (\ln \left (1-\left (x^{4}\right )^{\frac {1}{4}}\right )-\ln \left (1+\left (x^{4}\right )^{\frac {1}{4}}\right )+2 \arctan \left (\left (x^{4}\right )^{\frac {1}{4}}\right )\right )}{2 \left (x^{4}\right )^{\frac {3}{4}}}\) \(78\)

[In]

int((2*x^2+5)/(x^4-1),x,method=_RETURNVERBOSE)

[Out]

7/4*ln(x-1)-7/4*ln(x+1)-3/2*arctan(x)

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.31 \[ \int \frac {5+2 x^2}{-1+x^4} \, dx=-\frac {3}{2} \, \arctan \left (x\right ) - \frac {7}{4} \, \log \left (x + 1\right ) + \frac {7}{4} \, \log \left (x - 1\right ) \]

[In]

integrate((2*x^2+5)/(x^4-1),x, algorithm="fricas")

[Out]

-3/2*arctan(x) - 7/4*log(x + 1) + 7/4*log(x - 1)

Sympy [A] (verification not implemented)

Time = 0.07 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.69 \[ \int \frac {5+2 x^2}{-1+x^4} \, dx=\frac {7 \log {\left (x - 1 \right )}}{4} - \frac {7 \log {\left (x + 1 \right )}}{4} - \frac {3 \operatorname {atan}{\left (x \right )}}{2} \]

[In]

integrate((2*x**2+5)/(x**4-1),x)

[Out]

7*log(x - 1)/4 - 7*log(x + 1)/4 - 3*atan(x)/2

Maxima [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.31 \[ \int \frac {5+2 x^2}{-1+x^4} \, dx=-\frac {3}{2} \, \arctan \left (x\right ) - \frac {7}{4} \, \log \left (x + 1\right ) + \frac {7}{4} \, \log \left (x - 1\right ) \]

[In]

integrate((2*x^2+5)/(x^4-1),x, algorithm="maxima")

[Out]

-3/2*arctan(x) - 7/4*log(x + 1) + 7/4*log(x - 1)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 19 vs. \(2 (9) = 18\).

Time = 0.26 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.46 \[ \int \frac {5+2 x^2}{-1+x^4} \, dx=-\frac {3}{2} \, \arctan \left (x\right ) - \frac {7}{4} \, \log \left ({\left | x + 1 \right |}\right ) + \frac {7}{4} \, \log \left ({\left | x - 1 \right |}\right ) \]

[In]

integrate((2*x^2+5)/(x^4-1),x, algorithm="giac")

[Out]

-3/2*arctan(x) - 7/4*log(abs(x + 1)) + 7/4*log(abs(x - 1))

Mupad [B] (verification not implemented)

Time = 13.49 (sec) , antiderivative size = 9, normalized size of antiderivative = 0.69 \[ \int \frac {5+2 x^2}{-1+x^4} \, dx=-\frac {3\,\mathrm {atan}\left (x\right )}{2}-\frac {7\,\mathrm {atanh}\left (x\right )}{2} \]

[In]

int((2*x^2 + 5)/(x^4 - 1),x)

[Out]

- (3*atan(x))/2 - (7*atanh(x))/2